<?php
require "function_alias.php";
require "_constants.php";
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');
return array(
  'sourceLanguage'=>'en',
	
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Lahdekoodi',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=> require(dirname(__FILE__) . '/_imports.php'),
	/*
	'import'=>CMap::mergeArray(
			// Public Imported
			require(dirname(__FILE__) . '/_imports.php'),
			array(
				'application.extensions.....*',
			)
	),
	*/
	'defaultController'=>'dashboard',

	// application components
	'components'=>array(
		'mail' => array(
			'class' => 'application.components.JLMailer',
			'transportType'=>'smtp', /// case sensitive!
			'transportOptions'=>array(
				'host'=>'smtp.gmail.com',
				'username' => '2glemonloop@gmail.com',
				'password' => '2glemonloop123',
				'port'=>'465',
				'encryption'=>'ssl',
			),
			'viewPath' => 'application.views.mail',
			'logging' => true,
			'dryRun' => false
		),
		'bootstrap'=>array(
            'class'=>'bootstrap.components.Bootstrap',
        ),
		'email'=>array(
				'class'=>'application.extensions.email.Email',
				'delivery'=>'php', //Will use the php mailing function.
				//May also be set to 'debug' to instead dump the contents of the email into the view
		),
		'user'=>array(
			'class'=>'RWebUser',
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
			'authTimeout'		=>1800,
			'loginUrl' 			=> array('/user/login'),
		),
		//,class Controller extends RightsBaseController
    'authManager'=>array('class'=>'RDbAuthManager'),
											
		// 'db'=>array(
			// 'connectionString' => 'sqlite:protected/data/lahdekoo_yii.db',
			// 'tablePrefix' => 'tbl_',
 			// 'enableProfiling'=>true,
			// 'enableParamLogging'=>true,
		// ),
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=orange',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
			//'tablePrefix' => 'tbl_',
 			'enableProfiling'=>true,
			'enableParamLogging'=>true,
		),
		'errorHandler'=>array(
			// use 'site/error' action to display errors
				'errorAction'=>'site/error',
		),
		/*'log'=>array(
		    'class'=>'CLogRouter',
		    'routes'=>array(
		         array(
		            'class'=>'ext.yii-debug-toolbar.YiiDebugToolbarRoute',
		  
		            'ipFilters'=>array('127.0.0.1','192.168.2.*'),
		         ),
		    ),
		),*/
		
		'assetManager' => array(
			'basePath' => dirname(__FILE__) . "/../../wwwroot/assets/",
			'baseUrl' => "/../../wwwroot/assets",
		),
		
		'themeManager'	=> array(
			'basePath'	=> dirname(__FILE__) . '/../../themes/',
			'baseUrl'	=> dirname(__FILE__) . '/../../themes/',
			//'themeNames'	=>	array('frontend', 'backend', 'classic'),
		),
		'urlManager'=>array(
			'urlFormat'=>'path',
			'showScriptName'=>false,
			'rules'=>require(dirname(__FILE__) . '/_routes.php'),
			
		),
		'image'=>array(
			'class'=>'ImgManager',
			'versions'=>array(
				'small'=>array('width'=>120,'height'=>120),
				'medium'=>array('width'=>320,'height'=>320),
				'large'=>array('width'=>640,'height'=>640),
			),
		),
		/*
		'bootstrap'=>array(
        'class'=>'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
    ),
		*/
	),

	// Module
	'modules' => CMap::mergeArray(
		// Public Module
		require(dirname(__FILE__) . '/_modules.php'), 
		
		// Private module
		array(
			'category',
			'categories',
			'search',
			'products',
			'trade',
			'customer',
			'payment',
			'offers',
			'dashboard',
			'checkout',
			'admin',
			'payPal'=>array(
				'env'=>'sandbox',
				'account'=>array(
					// 'username'=>'Your PayPal API username',
					// 'password'=>'Your PayPal API password',
					// 'signature'=>'Your PayPal API signature',
					// 'email'=>'Your PayPal email address',
					// 'identityToken'=>'Your PayPal identity token',
					
					'username'=>'a12pct_1290753822_biz_api1.gmail.com',
					'password'=>'1290753839',
					'signature'=>'ArVM67jRXfn-SksiaXyTXqWkGDnrAviw1owDxi-GCEOJouQ8.vmT-V9o',
					'email'=>'a12pct_1290753822_biz@gmail.com',
					'identityToken'=>'-l-AS1JsjQdP2FFJeg8JZUy6nFhwTPLkXHyvN-Nvvy2XHwtXjcysNhHJzcy',
				),
				'components'=>array(
					'buttonManager'=>array(
						//'class'=>'payPal.components.PPDbButtonManager'
						'class'=>'payPal.components.PPPhpButtonManager',
					 ),
				),
			),
			'gii'=>array(
					'class'=>'system.gii.GiiModule',
					'generatorPaths' => array(
						// 'ext.giix-core', // giix generators
						'bootstrap.gii',
					),
					'password'=>'12345-'
			),
			
		)
	),
	
	// Set default theme
	'theme'=>'frontend',
	
	'params'	=>	require(dirname(__FILE__) . '/_params.php'), 
);
